;;;Sets dimstyles ENGRDIMS and ENGRLDRS and updates all dimensions to zero decimal places.
;;;All dimensions greater than max. distance for dimension leaders are updated to be
;;;regular dimensions (text above dimension line between arrows).  All other dimensions
;;;are updated to be dimension leaders.
;;;
;;;	Author:
;;;		Henry C. Francis
;;;		425 N. Ashe St.
;;;		Southern Pines, NC 28387
;;;
;;;     http://paracadd.com
;;;	All rights reserved.
;;;
(DEFUN C:DIMSEG ( / DIMSS SSLEN DIMCT DIMDATA SEGDIST LEADERSS ALIDIMSS)
  (SETQ DIMSS (SSGET "X" '((0 . "DIMENSION"))))
  (IF DIMSS
    (PROGN
;;;      (SETQ SEGDIST (UREAL 1 "" "Maximum distance for Dimension Leaders" (IF SEGDIST SEGDIST 25.0)))
      (SETQ SEGDIST 25.0)
      (SETQ SSLEN (SSLENGTH DIMSS)
	    DIMCT 0
	    LEADERSS (SSADD)
	    ALIDIMSS (SSADD)
      )
      (WHILE (< DIMCT SSLEN)
	(SETQ DIMDATA (ENTGET (SSNAME DIMSS DIMCT)))
	(IF
	  (<=(DISTANCE(CDR(ASSOC 13 DIMDATA))(CDR(ASSOC 14 DIMDATA)))SEGDIST)
	  (SSADD (CDR(ASSOC -1 DIMDATA)) LEADERSS)
	  (SSADD (CDR(ASSOC -1 DIMDATA)) ALIDIMSS)
	)
	(SETQ DIMCT (1+ DIMCT))
      )
    )
  )
  (IF (AND LEADERSS (>(SSLENGTH LEADERSS)0))
    (PROGN
      (IF C:ENGRLDRS NIL (LOAD "ENGRLDRS" "\nFile ENGRLDRS.LSP not loaded! "))
      (C:ENGRLDRS)
      (SETVAR "DIMDEC" 0)
      (COMMAND "DIM" "UPD" LEADERSS "")
      (COMMAND)
      (COMMAND)
    )
  )
  (IF (AND ALIDIMSS (>(SSLENGTH ALIDIMSS)0))
    (PROGN
      (IF C:ENGRDIMS NIL (LOAD "ENGRDIMS" "\nFile ENGRDIMS.LSP not loaded! "))
      (C:ENGRDIMS)
      (SETVAR "DIMDEC" 0)
      (COMMAND "DIM" "UPD" ALIDIMSS "")
      (COMMAND)
      (COMMAND)
    )
  )
  (PRINC)
)